import request from '@/utils/request'

//获取用户信息
export function getUserInfo() {
    return request({
        url: '/user/info',
        method: 'get'
      })
  }

  //更改用户信息
  export function modifyUserInfo(username, avatar, birthday, job, phone, email) {
    const data = {
        username, avatar, birthday, job, phone, email
    }
    return request({
        url: '/user/modify',
        method: 'post',
        data: data
      })
  }

  export function changeAvatar(avatarUrl) {
    const data = {
        avatarUrl
    }
    return request({
        url: '/api/user/avatar',
        method: 'post',
        data: data
      })
  }